#!/bin/bash
set -eu
scriptdir=$(cd $(dirname $0) && pwd)
cd $scriptdir

echo "👉 Generating CSS with all features enabled. This file's goan' be big!" >&2

staticdir=../../../static
targetfile=generated.full.css

if [[ "${1:-}" == "--watch" ]]; then
  echo "👀 Running Tailwind compilation in watch mode. 👀"
  npx tailwindcss build -c $scriptdir/tailwind.full.js -i styles.css -o $staticdir/css/$targetfile --watch
else
  npx tailwindcss build -c $scriptdir/tailwind.full.js -i styles.css -o $staticdir/css/$targetfile
  # Not minifying on purpose, to reduce merge conflicts if this file ever changes
fi
